package com.zcx.springcloud.payment9002.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("")
public class PaymentController {

    // 注意引入的@Value 注解的包 import org.springframework.beans.factory.annotation.Value;
    // 不是lombok的
    @Value("${server.port}")
    private String serverPort;

    // 传值方式 http://localhost:9527/payment/nacosNew/5
    @GetMapping(value = "/payment/nacos/{id}")
    public String getPayment(@PathVariable("id") Integer id) {
        return "nacos registry, serverPort: "+ serverPort+"\t id"+id;
    }

     // 传值方式 http://localhost:9527/payment/nacosNew?id=
    @GetMapping(value = "/payment/nacosNew")
    public String getPaymentNew(@RequestParam("id") Integer id) {
        return "nacosNew registry, serverPort: "+ serverPort+"\t id"+id;
    }


}
